<?php
$search = new search();
if($config['page']>1) {
    $config['site_title'] = 'Trang '.intval($config['page']).' - Kết quả tìm kiếm - Ket qua tim kiem - '.$config['keyword'].' - BanTinNhaDat.vn';
    $config['site_description'] = 'Trang '.intval($config['page']).' - Kết quả tìm kiếm - Ket qua tim kiem - '.$config['keyword'].' - '. $config['site_description'];
    $config['site_keyword'] = 'Trang '.intval($config['page']).' - Kết quả tìm kiếm, Ket qua tim kiem, '.$config['keyword'].' '. $config['site_keyword'];
}else {
    $config['site_title'] = 'Kết quả tìm kiếm - Ket qua tim kiem - '.$config['keyword'].' - BanTinNhaDat.vn';
    $config['site_description'] = 'Kết quả tìm kiếm - Ket qua tim kiem - '.$config['keyword'].' - '. $config['site_description'];
    $config['site_keyword'] = 'Kết quả tìm kiếm, Ket qua tim kiem, '.$config['keyword'].' '. $config['site_keyword'];
}
include_once $config ['client_theme_path'] . $config ['client_theme'] . '/header.php';
?>
<div id="b">
    <article>
        <?php
        $articles = $search->doSearch();
        foreach ($articles['arrRs'] as $row) {
            ?>
            <h3><a href="/<?php echo $row['link']; ?>.html" title="<?php echo viewTitleLink($row['title']); ?>"><?php echo $row['title']; ?></a></h3>
            <?php if (trim($row['image']) != '') { ?>
                <img src="<?php echo createThumb($row['image']); ?>" alt="<?php echo $row['title']; ?>"/>
                <?php
            }
            ?>
            <h2><?php echo cutString($row['short_description'], 200); ?></h2>
            <?php
        }
        ?>
        <?php
        if ($articles['totalPages']) {
            ?>
            <div class="panaging">
                <ul class="panation">
                    <?php
                    echo paging($config ['page'], $articles['totalPages'], $config['link']);
                    ?>
                </ul>
            </div>
            <?php
        }
        ?>
    </article>

    <?php include_once $config ['client_theme_path'] . $config ['client_theme'] . '/right.php'; ?>

</div>
<!-- END CONTAINER-->
<?php include_once $config ['client_theme_path'] . $config ['client_theme'] . '/footer.php'; ?>